<?php $this->load->view(TEMPLATE_NAME.'/front/header');?>
<?php $this->load->view(TEMPLATE_NAME.'/front/side_left');?>
<div class="page"> 

<form method="post" action="<?php echo site_url('analytics')?>" class="formm">
<p>Show result From 
<select name="start_month">
    <?php for($i =1; $i <= 12; $i++):
            $selected = '';
            $date = sprintf('%02s%4d',$i,(date('Y')-1));
            if ($startMonth == $date){
                $selected = 'selected';
            }
    ?>
        <option value="<?php echo $date;?>"  <?php echo $selected;?> ><?php echo $monthsList[$i].' '.(date('Y')-1) ?></option>
    <?php endfor;?>
    <?php for($i =1; $i <= 12; $i++):
            if ($i > date('m')){
                break;
            }
            $selected = '';
            $date = sprintf('%02s%4d',$i,date('Y'));
            if ($startMonth == $date){
                $selected = 'selected';
            }
    ?>
    <option value="<?php echo $date;?>" <?php echo $selected;?> ><?php echo $monthsList[$i].' '.date('Y') ?></option>
    <?php endfor;?>
    
</select> To  
<select name="end_month">
    <?php for($i =1; $i <= 12; $i++):
            $selected = '';
            $date = sprintf('%02s%4d',$i,(date('Y')-1));
            if ($endMonth == $date){
                $selected = 'selected';
            }
    ?>
        <option value="<?php echo $date;?>" <?php echo $selected;?> ><?php echo $monthsList[$i].' '.(date('Y')-1) ?></option>
    <?php endfor;?>
    <?php for($i =1; $i <= 12; $i++):
            if ($i > date('m')){
                break;
            }
            $selected = '';
            $date = sprintf('%02s%4d',$i,date('Y'));
            if ($endMonth == $date){
                $selected = 'selected';
            }

    ?>
        <option value="<?php echo $date;?>" <?php echo $selected;?> ><?php echo $monthsList[$i].' '.date('Y') ?></option>
    <?php endfor;?>
    
</select>

<button type="submit" value="submit" name="submit">Submit</button>
</p>
</form>

<?php
echo $graph;
?>

<?php $this->load->view(TEMPLATE_NAME.'/front/footer_menu');?>
</div><!-- page -->
<?php $this->load->view(TEMPLATE_NAME.'/front/side_right');?>
<?php $this->load->view(TEMPLATE_NAME.'/front/footer');?>